<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Biochemical Oxygen Demand</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="R.css">
</head><body>

<table width="100%" summary="page for BOD"><tr><td>BOD</td><td align="right">R Documentation</td></tr></table>

<h2> Biochemical Oxygen Demand </h2>

<h3>Description</h3>


<p>The <code>BOD</code> data frame has 6 rows and 2 columns giving the
biochemical oxygen demand versus time in an evaluation of water
quality.
</p>


<h3>Usage</h3>

<pre>BOD</pre>


<h3>Format</h3>


<p>This data frame contains the following columns:
</p>

<dl>
<dt>Time</dt><dd>
<p>A numeric vector giving the time of the measurement (days).
</p>
</dd>
<dt>demand</dt><dd>
<p>A numeric vector giving the biochemical oxygen demand (mg/l).
</p>
</dd>
</dl>



<h3>Source</h3>


<p>Bates, D.M. and Watts, D.G. (1988),
<EM>Nonlinear Regression Analysis and Its Applications</EM>,
Wiley, Appendix A1.4.
</p>
<p>Originally from Marske (1967), <EM>Biochemical
Oxygen Demand Data Interpretation Using Sum of Squares Surface</EM>
M.Sc. Thesis, University of Wisconsin &ndash; Madison.
</p>


<h3>Examples</h3>

<pre>

require(stats)
# simplest form of fitting a first-order model to these data
fm1 &lt;- nls(demand ~ A*(1-exp(-exp(lrc)*Time)), data = BOD,
   start = c(A = 20, lrc = log(.35)))
coef(fm1)
fm1
# using the plinear algorithm
fm2 &lt;- nls(demand ~ (1-exp(-exp(lrc)*Time)), data = BOD,
   start = c(lrc = log(.35)), algorithm = "plinear", trace = TRUE)
# using a self-starting model
fm3 &lt;- nls(demand ~ SSasympOrig(Time, A, lrc), data = BOD)
summary(fm3)

</pre>


</body></html>
